package com.yfp.client.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yfp.client.domain.ActivitySignInsClientRecords;
import com.yfp.client.domain.ActivitySignInsRules;
import com.yfp.client.domain.dto.ActivitySignInsExchangeRecordReqDTO;
import com.yfp.client.domain.dto.VerifyCouponDTO;
import com.yfp.client.domain.vo.ActivitySignInsRulesVO;

import java.util.List;

/**
 *
 * @description 针对表【activity_sign_ins_client_records(打卡管理-参与用户领取表)】的数据库操作Service
 * @createDate 2025-01-03 17:46:13
 */
public interface ActivitySignInsClientRecordsService extends IService<ActivitySignInsClientRecords> {

    /**
     * 领取奖励
     *
     * @param activitySignInsRulesId
     * @return
     */
    ActivitySignInsRules receiveReward(Long activitySignInsRulesId);

    /**
     * 根据活动id和用户id查询用户领取记录
     *
     * @param activitySignInsId
     * @return
     */
    List<ActivitySignInsClientRecords> getByClientAndId(Long activitySignInsId);

    /**
     * 填充用户是否已经领取
     *
     * @param activitySignInsId
     * @param activitySignInsRulesVOList
     * @return
     */
    List<ActivitySignInsRulesVO> fillIsReceive(Long activitySignInsId, List<ActivitySignInsRulesVO> activitySignInsRulesVOList);

    /**
     * 是否可以领取奖励
     * 计算当前用户是否可以领取奖励
     *
     * @param activitySignInsId
     * @param activitySignInsRulesVOList
     * @return true 可以领取奖励, false 不可以领取奖励
     */
    Boolean canReceiveReward(Long activitySignInsId, List<ActivitySignInsRulesVO> activitySignInsRulesVOList);

    /**
     * 是否可以领取奖励
     * 计算当前用户是否可以领取奖励
     *
     * @param activitySignInsId
     * @param activitySignInsRulesList
     * @return 有值可以领取奖励, null 不可以领取奖励
     */
    Long canReceiveReward2(Long activitySignInsId, List<ActivitySignInsRules> activitySignInsRulesList);

    /**
     * 当前用户是否已经全部领取完奖励
     *
     * @param activitySignInsId
     * @param activitySignInsRulesVOList
     * @return true 领取完奖励, false 未领取完奖励
     */
    Boolean isAllRewardsReceived(Long activitySignInsId, List<ActivitySignInsRulesVO> activitySignInsRulesVOList);

    /**
     * 兑换记录
     *
     * @param exchangeRecordReqDTO
     * @return
     */
    List<ActivitySignInsClientRecords> exchangeRecord(ActivitySignInsExchangeRecordReqDTO exchangeRecordReqDTO);

    /**
     * 验证and发放优惠券
     *
     * @param activitySignInsRules
     * @param clientId
     * @param couponPackId
     * @param cityName
     * @return
     */
    VerifyCouponDTO verifyCoupon(Long activitySignInsRules, String clientId, Long couponPackId, String cityName);
}
